<?php

namespace iBrand\Component\Goods;

use iBrand\Component\Goods\Repositories\BrandRepository;
use iBrand\Component\Goods\Repositories\Eloquent\BrandRepositoryEloquent;
use iBrand\Component\Goods\Repositories\Eloquent\GoodsProductRepositoryEloquent;
use iBrand\Component\Goods\Repositories\Eloquent\GoodsRepositoryEloquent;
use iBrand\Component\Goods\Repositories\Eloquent\SupplierRepositoryEloquent;
use iBrand\Component\Goods\Repositories\GoodsProductRepository;
use iBrand\Component\Goods\Repositories\GoodsRepository;
use iBrand\Component\Goods\Repositories\SupplierRepository;
use Illuminate\Support\ServiceProvider;

class GoodsServiceProvider extends ServiceProvider
{
	public function boot()
	{
		if ($this->app->runningInConsole()) {
			$this->loadMigrationsFrom(__DIR__ . '/../migrations');
		}
	}

	public function register()
	{
		$this->app->bind(GoodsRepository::class, GoodsRepositoryEloquent::class);

		$this->app->bind(GoodsProductRepository::class, GoodsProductRepositoryEloquent::class);

		$this->app->bind(SupplierRepository::class, SupplierRepositoryEloquent::class);

		$this->app->bind(BrandRepository::class, BrandRepositoryEloquent::class);
	}
}